/** 搜索配置 */
export interface SearchOptionType {
  list?: SearchOptionItemType[]
  btns?: SearchOptionBtnType[]
}

/**
 * 搜索项配置
 */
export type SearchOptionItemType = SearchOptionItemTypeText | SearchOptionItemTypeSelect

/** 搜索项基础配置 */
export interface SearchOptionItemTypeBase {
  title?: string
  name: string
}
/** 搜索项text配置 */
export interface SearchOptionItemTypeText extends SearchOptionItemTypeBase {
  type: 'text'
  value?: string | number
  /** 是否隐藏提示语 */
  hidePlaceholder?: boolean
  /** 是否隐藏清空按钮 */
  hideClear?: boolean
}
/** 搜索项select配置 */
export interface SearchOptionItemTypeSelect extends SearchOptionItemTypeBase {
  type: 'select'
  value?: string | number
  selectOption: {
    itemList?: selectOptionItemType[]
  }
  /** 是否隐藏提示语 */
  hidePlaceholder?: boolean
  /** 是否隐藏清空按钮 */
  hideClear?: boolean
}

/** 搜索项select配置中 选项的配置 */
interface selectOptionItemType {
  title: string
  value: string | number
}

/**
 * 按钮项相关配置
 */
export interface SearchOptionBtnType {
  title: string
  onClick(): void
  disabled?: boolean
  hide?: boolean
}
